<template>
  <div class="suc__mask" v-if="showConfirm">
    <div class="suc__mask__content">
      <div class="suc__mask__checked iconfont">&#xe65a;</div>
      <div class="suc__mask__title">{{ maskMessage }}</div>
    </div>
  </div>
</template>

<script>
import { reactive, toRefs } from "vue";

export default {
  name: "BlackMask",
  props: ["maskMessage"],
};


export const useMaskEffect = () => {
  const maskData = reactive({
    show: false,
    maskMessage: "",
  });

  const showMask = (maskMessage) => {
    maskData.show = true;
    maskData.maskMessage = maskMessage;
    //setTimeout(() => {
    //  maskData.show = false;
    //  maskData.toastMessage = "";
    //}, 2000);
  };

  const { show, maskMessage } = toRefs(maskData);

  return { show, maskMessage, showMask };
};
</script>

<style lang="scss" scoped>
.suc__mask {
  z-index: 1;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  background: rgba(0, 0, 0, 0.5);

  &__content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 3rem;
    height: 1.56rem;
    background: #fff;
    text-align: center;
    border-radius: 0.04rem;
  }
  &__title {
    margin: 0.6rem 0 0 0;
    line-height: 0.26rem;
    font-size: 0, 2rem;
    color: #333;
  }
}
</style>